/**
 * Created by lintao_alex on 2018/8/26.
 */


namespace game{
    import BaseMediator = mengdao.BaseMediator;
    import UI_console = common.UI_console;

    export class ConsoleMediator extends BaseMediator{
        get ui():common.UI_console{
            return this._ui;
        }
        private _ui:UI_console;

        public constructor(ctx:Context){
            super(ctx);
            let ui = UI_console.createInstance();
            this._ui = ui;
            ui.btnBg1.addClickListener(()=>{
                // this.dispatchEventWith(UIEvent.OPEN, Ground1View)
            },this)
            ui.btnBg2.addClickListener(()=>{
                // this.dispatchEventWith(UIEvent.OPEN, Ground2View)
            },this)
            ui.btnLogin.addClickListener(()=>{
                this.dispatchEventWith(UIEvent.OPEN, LoginWindow)
            },this)
            ui.btnBar.addClickListener(()=>{
                this.dispatchEventWith(UIEvent.OPEN, BarWindow)
            },this)
            ui.alpha = 0.5
        }

        onInit(){
        }

        onUpdate(){
        }

        onClose(){
        }
    }
}